﻿@model MobileSales.Model.Products.Product

@{
    View.Title = Strings.Products + " - " + Strings.Details;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@Strings.Products &nbsp;&raquo;&nbsp; @Strings.Details</h2>

<fieldset>
    <legend>@Strings.Fields</legend>

    <div class="display-label">@ModelStrings.Sku</div>
    <div class="display-field">@Model.Sku</div>

    <div class="display-label">@ModelStrings.Name</div>
    <div class="display-field">@Model.Name</div>

    <div class="display-label">@ModelStrings.Description</div>
    <div class="display-field">@Model.Description</div>

    <div class="display-label">@ModelStrings.Price</div>
    <div class="display-field">@Model.Price</div>

    <div class="display-label">@ModelStrings.Quantity</div>
    <div class="display-field">@Model.Quantity</div>

    <div class="display-label">@ModelStrings.MinQuantity</div>
    <div class="display-field">@Model.MinQuantity</div>

    <div class="display-label">@ModelStrings.OrderQuantity</div>
    <div class="display-field">@Model.OrderQuantity</div>

    <div class="display-label">@ModelStrings.Spread</div>
    <div class="display-field">@Model.Spread</div>

    <div class="display-label">@ModelStrings.Symbol</div>
    <div class="display-field">@Model.Symbol</div>

    <div class="display-label">@ModelStrings.IsMarketingOnlyItem</div>
    <div class="display-field">@(Model.IsMarketingOnlyItem ? Strings.Yes : Strings.No)</div>         

    <div class="display-label">@ModelStrings.Tax</div>
    <div class="display-field">@Html.PercentageFormat(Model.Tax.Value)</div>  

    <div class="display-label">@ModelStrings.Unit</div>
    <div class="display-field">@Model.Unit.Name</div>  

        <hr />
        @Html.ParamsFor(MobileSales.Model.Params.ParamType.Product, Model.Params)

    <br />
    
    @Html.ActionLink(Strings.UploadPhoto, "Create", "ProductImages", new { productId = Model.Id }, new { @class = "icon-button add-icon" })

    <br /><br />

    @if (Model.Images.Count > 0)
    {
        <table style="width: auto">
        <tr>
            @foreach(var img in Model.Images) {
                <td width="160">
                    <img src="@img.Path" alt="@Model.Name" width="150" /><br /><br />
                    @Html.ActionLink(Strings.Delete, "Delete", "ProductImages", new { id = img.Id, productId = Model.Id }, new { @class = "icon-button delete-icon" })
                </td>
            }
        </tr>
        </table>
    }

</fieldset>
<p>
    @Html.ActionLink(Strings.Edit, "Edit", new { id = Model.Id }, new { @class = "icon-button edit-icon" }) |
    @Html.ActionLink(Strings.BackToList, "Index", null, new { @class = "icon-button prev-icon" })
</p>
